package com.sqber.nacos.nacosSpringBootDemo.controller;

import com.sqber.nacos.nacosSpringBootDemo.config.Person;
import com.sqber.nacos.nacosSpringBootDemo.config.SomeConf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @Autowired
    private SomeConf someConf;
    @Autowired
    private Person person;

    @GetMapping("/")
    public String index() {
        return "this is an nacos spring boot demo";
    }

    /************** 测试配置项 ******************/

    @GetMapping("/orgid")
    public String orgid() {
        return someConf.getOrgId();
    }

    @GetMapping("/person")
    public String person() {
        return person.toString();
    }
}
